<?php include 'frame-top.php'; ?>

<div class="segm" style="border-bottom:1px solid #ccc;">
	<h2>实验室成员: &nbsp;
		<span>
			<a href="#instructors">教师</a> &nbsp;
			<a href="#phds">在读博士</a> &nbsp;
			<a href="#masters">在读硕士</a> &nbsp;
			<a href="#graduates">往届毕业生</a> &nbsp;
			<?php
			if (auth::check(auth::EDIT_MEMBER))
				$addBtn = '<input type="button" value="add member" '.
						  ' onclick="show_add_person(1);" />';
			else
				$addBtn = '';
			echo $addBtn;
			?>
		</span>
	</h2>
</div>


<!-- instructors -->
<div class="segm"> <a name="instructors"></a>
	<h2>教师.Instructors</h2>
	<?php
	foreach ($this->teacher as $teacher) {
		$d=$teacher;
		$race=strlen($d['Race'])>1?$d['Race']:'';
		$birth=$d['Birth']=='NULL'?'':'，'.$d['Birth'];
		$edit = auth::check(auth::PRIV_ADMIN)?
					"<input type='button' value='edit' onclick=".
					"\"location.href='/member/edit/AId/{$d['AId']}';\" /> ".
					"<input type='button' value='del' onclick='del_account(".
					"{$d['AId']})' />" : '';
		echo "<div class='instr'>
				<a href='javascript:show_member({$d['AId']});'>
				<img src='/pub/icon/{$d['Icon']}' class='icon'
					alt='照片:{$d['Name']}'
					style='width:150px;border:none;' /></a>
				<div class='param'>
					<h3><a href='javascript:show_member({$d['AId']});'>
						{$d['Name']}</a>，{$d['Sex']} $race
						{$birth}。 $edit
					</h3>
					<div class='info'>{$d['Status']}</div>
					<div class='info'>{$d['Intro']}</div>
					<div class='info'>主要研究方向：{$d['Interest']}</div>
					<p style='text-align:right;'>
						<a href='javascript:show_member({$d['AId']});'>".
						"&raquo; 详细信息</a>
					</p>
				</div>
				<div class='clear'></div>
			</div>\n";	
	}
	?>
	<div class="clear"></div>
</div> <!-- end of instructors -->

<!-- ph.Ds -->
<div class="segm" style="border-bottom:1px solid #ccc;"> 
	<a name="phds"></a>
	<h2>在读博士.Ph.Ds <?=$addBtn?></h2>
	<ul class="stud">
		<?php 
		foreach ($this->phd as $d) {
			echo "<li><a href='javascript:show_member({$d['AId']});'>".
				"{$d['Name']}</a>";
			if ($this->edit_student)
				echo "[<a href='javascript:edit_member(".
					$d['AId'].");'>Edit</a>]";
			echo "</li>\n";
		}
		?>
	</ul>

	<div class="to_top"><a href="#">Top</a></div>
</div> <!-- end of ph.Ds -->

<!-- masters -->
<div class="segm" style="border-bottom:1px solid #ccc;"> 
	<a name="masters"></a>
	<h2>在读硕士.Masters <?=$addBtn?></h2>
	<ul class="stud"><?php 
		foreach ($this->master as $d) {
			echo "<li><a href='javascript:show_member({$d['AId']});'>".
				"{$d['Name']}</a>";
			if ($this->edit_student)
				echo "[<a href='javascript:edit_member(".
					$d['AId'].");'>Edit</a>]";
			echo "</li>\n";
		}
		?>
	</ul>

	<div class="to_top"><a href="#">Top</a></div>
</div> <!-- end of masters -->

<!-- graduates -->
<div class="segm"> 
	<a name="graduates"></a>
	<h2>往届毕业生.Graduates <?=$addBtn?></h2>
	<ul class="stud"><?php 
		foreach ($this->graduate as $d) {
			echo "<li><a href='javascript:show_member({$d['AId']});'>".
				"{$d['Name']}</a>";
			if ($this->edit_student)
				echo "[<a href='javascript:edit_member(".
					$d['AId'].");'>Edit</a>]";
			echo "</li>\n";
		}
		?>
	</ul>

	<div class="to_top"><a href="#">Top</a></div>
</div> <!-- end of graduates -->


<?php include 'frame-bottom.php'; ?>
